<template>
  <div class="index-container">
    <IndexHead
      :acount="acount"
      :password="password"
      :teamName="teamName"
    ></IndexHead>
    <IndexMain></IndexMain>
  </div>
</template>

<script>
import IndexHead from '../components/Index/IndexHead'
import IndexMain from '../components/Index/IndexMain'
import eventBus from '../components/eventBus'

export default {
  name: 'Index',
  components: {
    IndexMain,
    IndexHead
  },
  activated () {
    // eslint-disable-next-line no-unused-expressions
    eventBus.$on('userInformation', (e) => {
      this.acount = e.acount
      this.password = e.pwd
      // eslint-disable-next-line no-sequences
    }),
    eventBus.$on('joinTeamInformation', (e) => {
      this.teamName = e.teamName
    }),
    eventBus.$on('creatTeamInformation', (e) => {
      this.teamName = e.teamName
    })
  },
  data () {
    return {
      acount: '',
      password: '',
      teamName: ''
    }
  }
}
</script>

<style scoped>
.index-container {
  width: 100%;
}
</style>
